/**
 * Author: luoqi
 * Created Date: 2025-11-12 21:40:17
 * Last Modified: 2025-11-13 01:32:48
 * Modified By: luoqi at <**@****>
 * Copyright (c) 2025 <*****>
 * Description:
 */

#ifndef _UART_PORT_H_
#define _UART_PORT_H_

#include <stddef.h>

#ifndef UART_RX_BUFSZ
#define UART_RX_BUFSZ (64)
#endif

#ifndef UART_TX_BUFSZ
#define UART_TX_BUFSZ (64)
#endif

#ifndef UART_TX_RB_BUFSZ
#define UART_TX_RB_BUFSZ (512)
#endif

#ifndef UART_RX_RB_BUFSZ
#define UART_RX_RB_BUFSZ (64)
#endif

typedef enum {
    UART_PORT1,
} UartPort;

int uart_port_init(void);

int uart_write(UartPort port, const void *data, size_t sz);

int uart_read(UartPort port, void *data, size_t sz);

int uart_transfer(UartPort port, const void *data, size_t sz, size_t timeout);

#endif
